/////////////////////////////////////////////////////////
// acd_manager.h
/////////////////////////////////////////////////////////
#pragma once

typedef struct ACDUSER
{
public:
   ACDUSER()
   {
      memset( mStrCallerID, 0, 64 );
      memset( mStrCalleeID, 0, 64 );
   }
   char mStrCallerID[64];
   char mStrCalleeID[64];
   
   ACDUSER operator=( const struct ACDUSER &aOther )
   {
      snprintf( mStrCallerID, 64, "%s", aOther.mStrCallerID );
      snprintf( mStrCalleeID, 64, "%s", aOther.mStrCalleeID );
      return * this;
   };
   
   int operator==( const struct ACDUSER &aOther )
   {
      if ( !memcmp( mStrCallerID,
                    aOther.mStrCallerID,
                    strlen( aOther.mStrCallerID ) ) )
      {
         if ( !memcmp( mStrCalleeID,
                       aOther.mStrCalleeID,
                       strlen( aOther.mStrCalleeID ) ) )
         {
            return 1;
         }
      }
      return 0;
   };
   
}ACDUSER;

void run_acd_manager();
void stop_acd_manager();
int add_acd_list( char * aFileName );

void * acd_manager( void * aArg );
int init_acd_manager( char * aOutgoingFolderPtr,
                      char * aListFolderPtr,
                      char * aAstUserNamePtr,
                      int    aCounsellorReadyTime );

int add_member( char * aMemberInfoPtr );
int add_customer( char * aCustomerNumPtr );

void generate_customer_call_withoutid( char * aOutNumPtr,
                                       char * aConfNumPtr );

void generate_customer_call_withid( char * aOutNumPtr,
                                    char * aConfNumPtr,
                                    char * aOutIDPtr );

void generate_customer_call( char * aOutNumPtr,
                             char * aConfNumPtr,
                             char * aOutIDPtr );

void generate_member_call( char * aOutNumPtr,
                           char * aConfNumPtr,
                           char * aOutIDPtr );

void generate_call( char * aOutNumPtr,
                    char * aConfNumPtr,
                    char * aOutIDPtr,
                    char * aOutChanName );

void kick_member( char * aMemberNumPtr );

/////////////////////////////////////////////////////////
